Welcome to Linux Terminal Overview. After watching this video, you will be able to: Describe what the Linux shell is. Describe what a Linux terminal is. Explain how a Linux terminal
and shell work together. And use a Linux terminal to navigate directories. The Linux shell is an OS-level application
that interprets commands. In early versions of Unix and Linux, the shell was the only way
to interact with the operating system. Today, you can also use graphical user interfaces, but the shell remains a popular and flexible
choice and an easy way to run script files. You can use shell commands to perform
tasks such as moving and copying files, writing to and reading from files, extracting
and filtering data, and searching for data. There are many shell versions, but the base functionality of most is
the same. Some popular examples include: Bash And Zsh. You interact with the Linux
shell through a Linux terminal. A terminal is an application, or user interface, where you enter the commands you want to run
and receive any output from those commands. For example, to start the Python application
and run a program called ”myprogram.py", type python space myprogram.py.
When you press Enter, the shell runs the command. This program prints the
words “Hello, World!” to the terminal. So how are commands run? First, we have a user who wants to run a command. They enter the command in a terminal, which is then relayed to the shell. The core components of the operating system and kernel translate the command
for the hardware to perform. When the hardware completes the command, the kernel reads any changes or results and sends them back via the shell to the terminal for the user’s information. The terminal is a powerful way to run
applications and interact with your machine. Most terminals have a similar user
interface for you to enter commands. The area where you enter commands
is called the command line. And the vertical line, or cursor, is the command prompt. This indicates where
the text that you type will be displayed. In this example, the current working
directory is the Documents directory, which is inside the me directory, which
is inside the home directory. The current working directory is the location where
the shell will look for any commands that you specify to run, for example, the
Python program in the previous example. Not all terminals display
the full location, or path, of your current directory, so some
will just display Documents here. The path is the human-readable location of
a directory or file in the Linux filesystem. The “a slash b” structure indicates that the file or directory named "b" is located
inside the directory named "a". There are also special paths: A single tilde symbol refers
to the user’s home directory. A single slash at the beginning of
a path refers to the root directory. Two periods refer to the parent
of the current directory. And a single period refers
to the current directory. So, let’s look at how you can use the terminal
to change the current working directory. You use the cd command that
stands for change directory. Enter cd / to go to the root directory. And enter cd bin to move into the bin directory. The bin directory, which is inside root,
contains programs required by the system. One of these programs, or
executable files, is called “ls”. You can run the ls program in the current
working directory by entering ./ls Use it to display in the terminal window the names of all files and directories
within the current directory. Many commands located in the bin
folder are also built into the shell, so you can run them from other locations too. Navigate to your home directory using cd ~ And even though the current
working directory, /home/me, doesn't contain the ls program, you can still run the command successfully. Let's look at some more examples. Again, starting in the /home directory Enter "cd .." to change the current working
directory to the parent of the existing current working directory. So, in this example
the parent of /home is /, or the root directory. To then navigate to a USB drive called
my-usb-drive in the media directory, enter cd /media/my-usb-drive. You can also navigate up and down the tree in one command. To navigate up to the
media directory then up to the root, enter cd ../.. and then to navigate down to the Documents directory in the me
directory in the home directory, enter /home/me/Documents. Press Enter to submit the command
and move to the Documents folder. Let’s move up to the /home/me directory, start the Python application, and run a program
in the /home/me directory called myprogram.py. This program returns a message
to the terminal window. In this video, you learned that: A Linux shell is an OS-level application that you can use to enter commands and
view the output of those commands. You use a terminal to send commands to the shell. And you can use the cd command to
navigate around your Linux filesystem.